
import java.util.ArrayList;
import java.util.Observable;
import java.util.Observer;

public class Chapter implements Observer{

    private StoryTimer timer = null;
    private int startTime;
    private int duration;
    //private ArrayList <Scene> scenes;
    //private Scene currentScene;

    public Chapter(StoryTimer t, int start, int duration){
        this.timer = t;
        t.addObserver(this);
        
        startTime=start;
        this.setDuration(duration);
    }

    @Override
    public void update(Observable obs, Object obj) {
        System.out.println(timer.getRemTime() + " seconds Remaining");
        timer=(StoryTimer)obs;
        checkStartTimeAchieved(timer.getRemTime());
    }
    
    public void checkStartTimeAchieved(int remTime)
    {
    if (startTime==remTime)
    {
    	//Start showing scenes
    }
    }

	public void setDuration(int duration) {
		this.duration = duration;
	}

	public int getDuration() {
		return duration;
	}
	
	public void setStartTime(int start) {
		this.startTime = start;
	}

	public int getStartTime() {
		return startTime;
	}

}
